package com.bbznb.config;

import dev.langchain4j.memory.ChatMemory;
import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import dev.langchain4j.model.openai.OpenAiChatModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class chatMemoryConfig {
    @Autowired
    private OpenAiChatModel openAiChatModel;

    @Bean
    public ChatMemory chatMemory() {

        return     MessageWindowChatMemory.builder().maxMessages(20)
                .build();
        }
}
